const { MYSQL_CONF, isProd } = require("./db");

var mysqlConfig = {
  ...MYSQL_CONF,
  define: {
    // 是否冻结表名, 默认表名会转换为复数形式
    freezeTableName: true,
    // 是否为表添加 createdAt 和 updatedAt 字段
    // createdAt 记录表的创建时间
    // updatedAt 记录字段更新时间
    timestamps: true,
    // 是否为表添加 deletedAt 字段
    // 默认情况下, destroy() 方法会删除数据，设置 paranoid 为 true 时，将会更新 deletedAt 字段，并不会真实删除数据。
    paranoid: false,
  },
  dialect: "mysql",
};

const publicKey = `-----BEGIN PUBLIC KEY-----
MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKFX2WBHAhPnhbev8NmZLwHVxv3db/iN
Zvj1OelOapTOVRnXdQXO4gbPcPKs01Kt9JfX773705hCijh2KGs0YeMCAwEAAQ==
-----END PUBLIC KEY-----`;
const privateKey = `-----BEGIN PRIVATE KEY-----
MIIBUwIBADANBgkqhkiG9w0BAQEFAASCAT0wggE5AgEAAkEAoVfZYEcCE+eFt6/w
2ZkvAdXG/d1v+I1m+PU56U5qlM5VGdd1Bc7iBs9w8qzTUq30l9fvvfvTmEKKOHYo
azRh4wIDAQABAkBYbDngzumvmOoqwkzgJFijy9JT3SD5eh1eAZ9sYqJ8zDdigiIP
o2EpC7cBB+brIvRtQ5qrJowYEvWd2v0KMvfpAiEA/nhF1WNjdsWQT3iwgHqcZJ3d
XSOt9OVBAWp3zpnVS98CIQCiUDfvAidUupKSlAQfGtrGrccrVzQ1gh/6dGVhV9xq
fQIgTWGTks0zXNW9CX2g5qDiV/Jtczo7VuIz/1M59XhwFS8CIGqqRNewlqA7q67f
zoWSZEtEUCrPN+QiC1nPu//oeVURAiBuCrj6vtM6N/AejrdNfG8jQiJAvMhNEnS3
FN8lq90Frw==
-----END PRIVATE KEY-----`;

const origin_host = isProd ? "https://www.ytko.cn" : "http://localhost:8080";

module.exports = {
  mysqlConfig,
  publicKey,
  privateKey,
  origin_host,
};
